<?php
	include("general_include.php");
	include "checklogin.php";
	
	$sqlQuery = "SELECT ut.nk_transaction_id, ut.tx_date, ut.qty_points*rp.qty_points AS transaction_points, CONCAT(rp.description, '. ', ts.description) AS description FROM ".TABLEPREFIX."_user_transaction ut, ".TABLEPREFIX."_transaction_status ts, ".TABLEPREFIX."_rate_points rp WHERE ut.nk_user_id=".$_SESSION['user_id']." AND ut.status = ts.nk_transaction_status_id AND ut.rate_point_id = rp.rate_point_id ORDER BY tx_date DESC, nk_transaction_id";
	
	$transactionList = $UserManagerObjAjax->GetRecords("All",$sqlQuery);				
	
	$noTransactions = count($transactionList);
	
	$rows = 10;
	$cols = 4;
	$page = isset($_GET['page'])?$_GET['page']:1;
	$sort = isset($_GET['sort'])?$_GET['sort']:-1;
	
?>
<table>
<tbody>
	<?php 
	echo $noTransactions;
		if($page>=0 && ($rows*($page-1))<$noTransactions)
			for ($i=($rows*($page-1)); $i<(($rows*($page-1))+$rows); $i++): 
	?>
			<tr>
				<?php
				for ($j=0; $j<$cols; $j++) {
					echo "<td>". $transactionList[$i][$j] ."</td>";
				}
				?>
			</tr>
	<?php endfor; ?>
</tbody>
</table>